<template>
  <div>
    <table>
      <tr
        is="lianxi5"
        v-for="(item, index) in goodsArr"
        :key="index"
        :obj="item"
        :index="index"
      ></tr>
    </table>
    <p>总价:{{ sumNumber }}</p>
  </div>
</template>

<script>
import lianxi5 from "./conmporints/lianxi5";
export default {
  data() {
    return {
      goodsArr: [
        {
          count: 0,
          goodsName: "",
        },
        {
          count: 0,
          goodsName: "",
        },
        {
          count: 0,
          goodsName: "",
        },
        {
          count: 0,
          goodsName: "",
        },
        {
          count: 0,
          goodsName: "",
        },
      ],
    };
  },
  components: {
    lianxi5,
  },
  computed: {
    sumNumber() {
      return this.goodsArr.reduce((usm, obl) => 
        (usm += obl.count * 1), 0
      );
    },
  },
};
</script>

<style>
</style>